import http from '@/utils/request'
//  获取角色列表
export const getRoleList = (data, config) => {
  return http.get('/sys/role/page', {params: data}, config)
}

//  获取菜单列表
export const getMenuList = (data, config) => {
  return http.get('/sys/permission/list', data, config)
}

//  新增角色
export const addNewRole = (data, config) => {
  return http.post('/sys/role/add', data, config)
}

//  修改角色
export const editOldRole = (data, config) => {
  return http.post('/sys/role/update', data, config)
}

// 获取角色详情
export const getRoleDetail = (data, config) => {
  return http.get(`/sys/role/get?id=${data.id}`, data, config)
}
// 删除角色
export const delRoleById = (data, config) => {
  return http.post(`/sys/role/delete`, data, config)
}

// 删除角色
export const delMeetingRoleById = (data, config) => {
  return http.delete(`/sys/conferenceRole/remove/${data.roleIds}`, data, config)
}

//  获取人员列表
export const getPersonList = (data, config) => {
  return http.post(`/sys/user/page?page=${data.pageNum}&pageSize=${data.pageSize}`, data, config)
}

//  新增用户
export const addNewUsers = (data, config) => {
  return http.post('/sys/user/add', data, config)
}

//  获取用户详情
export const getUsersByUserId = (data, config) => {
	return http.get(`/sys/user/get?id=${data.userId}`, data, config)
}

//  修改用户
export const editNewUsers = (data, config) => {
	return http.post('/sys/user/update', data, config)
}

//  删除用户
export const delNewUsers = (data, config) => {
	return http.post(`/sys/user/delete`, data, config)
}

//  获取已分配用户列表
export const allocatedList = (data, config) => {
  return http.get(`/system/role/authUser/allocatedList/${data.roleId}`, data, config)
}

//  获取未分配用户列表
export const unallocatedList = (data, config) => {
  return http.get(`/system/role/authUser/unallocatedList/${data.roleId}`, data, config)
}

//  获取已分配用户列表
export const meetingAllocatedList = (data, config) => {
  return http.get(`/system/conferenceRole/authUser/allocatedList/${data.roleId}`, data, config)
}

//  获取未分配用户列表
export const meetingUnallocatedList = (data, config) => {
  return http.get(`/system/conferenceRole/authUser/unallocatedList/${data.roleId}`, data, config)
}

//  批量分配用户列表
export const batchAuth = (data, config) => {
  return http.put(`/system/role/authUsers/batchAuth?roleId=${data.roleId}&userIds=${data.userIds}`, data, config)
}

//  批量分配用户列表
export const meetingBatchAuth = (data, config) => {
  return http.put(`/system/conferenceRole/authUsers/batchAuth?roleId=${data.roleId}&userIds=${data.userIds}`, data, config)
}

// 获取客户列表
export const getCustomerList = (data, config) => {
  return http.post(`/system/userConsumer/list?pageNum=${data.pageNum}&pageSize=${data.pageSize}`, data, config)
}

// 新增客户
export const saveUserConsumer = (data, config) => {
  return http.post(`/system/userConsumer`, data, config)
}

// 修改客户
export const updateUserConsumer = (data, config) => {
  return http.put(`/system/userConsumer`, data, config)
}

// 获取客户详情信息
export const getUserDetailById = (data, config) => {
  return http.get(`/system/userConsumer/detail/${data.userId}`, data, config)
}

// 冻结/解封客户
export const userFreeze = (data, config) => {
  return http.put(`/system/userConsumer/freeze`, data, config)
}

// 删除客户
export const deleteUserConsumer = (data, config) => {
  return http.delete(`/system/userConsumer/${data.userIds}`, data, config)
}

// 设置项目权限
export const setProjectPermission = (data, config) => {
  return http.put(`/system/user/setProjectPermission?userId=${data.userId}&permissionUserId=${data.permissionUserId}`, data, config)
}

// 获取用户项目权限
export const getPermissionIds = (data, config) => {
  return http.get(`/system/user/getPermissionIds/${data.userId}`, {params: data}, config)
}

//  获取套餐列表
export const getSetList = (data, config) => {
  return http.get('/system/set/list', {params: data}, config)
}

//  获取权限树
export const getRoleTree = (data, config) => {
  return http.get('/sys/role/tree', {params: data}, config)
}

//  获取文件分发配置
export const getSendFileConfig = (data, config) => {
  return http.get(`/sendfile/config/manage/get`, data, config)
}
// 保存文件分发配置
export const saveSendFileConfig = (data, config) => {
  return http.post(`/sendfile/config/manage/save`, data, config)
}
// 同步所有终端
export const syncAll = (data, config) => {
  return http.post(`/sendfile/media/send-record/syncAll`, data, config)
}
